package com.ycg.vue.result;

import lombok.Data;

import java.util.List;

/**
 * @Description
 * @Author jink
 * @Date 2024/8/28
 */
@Data
public class WeatherResponse {
    private Location location;
    private Current current;
    private Forecast forecast;
    private Alerts alerts;

    @Data
    public static class Location {
        // 城市名称
        private String name;
        // 城市经度
        private String region;
        // 城市纬度
        private String country;
        // 城市ID
        private String localtime;
        // 维度
        private double lat;
        // 经度
        private double lon;
    }

    @Data
    public static class Current {
        // 当前温度，单位为摄氏度
        private double temp_c;
        // 当前温度，单位为华氏度
        private double uv;
        //天气状况的描述
        private Condition condition;
        //风速
        private double wind_kph;
        //风向
        private String wind_degree;
        //气压
        private double pressure_mb;
        //降水量
        private double precip_mm;
        //相对湿度
        private double humidity;
        //云量
        private double cloud;
        //体感温度
        private double feelslike_c;
        //体感温度
        private double feelslike_f;
        // 能见度（公里）
        private double vis_km;
    }

    @Data
    public static class Forecast {
        private List<ForecastDay> forecastday;
    }

    @Data
    public static class ForecastDay {
        private String date;
        private Astro astro;
        private Day day;
    }

    @Data
    public static class Astro {
        //日出时间
        private String sunrise;
        //日落时间
        private String sunset;
        //月落时间
        private String moonrise;
        //月落时间
        private String moonset;
        //月相
        private String moon_phase;
        //月亮光照度
        private String moon_illumination;
    }

    @Data
    public static class Day {
        private double maxtemp_c;
        private double mintemp_c;
        private Condition condition;
    }

    @Data
    public static class Alerts {
        private String headline;
        private String msgtype;
        private String severity;
    }

    @Data
    public static class Condition {
        private String text;
        private String icon;
        private String code;
    }
}